package trash;

public class Try {

    public static void main(String[] args) {
        booleanResultCalculator();
    }

    public static void booleanResultCalculator() {

        Boolean res1;
        Boolean res2;
        Integer zahl;



        res1 = null;
        res2 = null;
        zahl = null;

        boolean nullSafeCheck1 = (res1 != null && zahl != null);
        boolean nullSafeCheck2 = (res2 != null);
        if ((nullSafeCheck1 && ((res1.equals(Boolean.FALSE)) && (zahl < 8)))
                || (nullSafeCheck2 && (res2.equals(Boolean.TRUE)))) {
            System.out.println("ok");
        } else {
            System.out.println("none of the or-expressions is true, i.e. they are all false or not null safe");
        }



        res1 = Boolean.TRUE;
        zahl = new Integer(7);
        res2 = null;
        nullSafeCheck1 = (res1 != null && zahl != null);
        nullSafeCheck2 = (res2 != null);

        if ((nullSafeCheck1 && ((res1.equals(Boolean.TRUE)) && (zahl < 8)))
                || (nullSafeCheck2 && (res2.equals(Boolean.TRUE)))) {
            System.out.println("condition evaluates to true, i.e. at least one operand in or-condition is true ");
        } else {
            System.out.println("all operand in or-condition are false, i.e. they are false and / or not null safe");
        }

        
        
        res1 = null;
        zahl = null;        
        res2 = Boolean.TRUE;
        nullSafeCheck1 = (res1 != null && zahl != null);
        nullSafeCheck2 = (res2 != null);

        if ((nullSafeCheck1 && ((res1.equals(Boolean.TRUE)) && (zahl < 8)))
                || (nullSafeCheck2 && (res2.equals(Boolean.TRUE)))) {
            System.out.println("condition evaluates to true, i.e. at least one operand in or-condition is true");
        } else {
            System.out.println("all operand in or-condition are false, i.e. they are false and / or not null safe");
        }

    }
}
